import fltk

class ToDoApp:
    def __init__(self):
        self.tasks = []
        self.win = fltk.Fl_Window(400,400,"Todo")
        self.input = fltk.Fl_Input(0,0,350,40,"Input")
        self.search = fltk.Fl_Input(0,40,350,40,"Search")
        self.add_button = fltk.Fl_Button(350,0,50,40,"Add")
        self.add_button.callback(self.on_add)
        self.browser = fltk.Fl_Browser(0,80,400,200)
        self.del_button = fltk.Fl_Button(350,40,50,40,"Del")
        self.win.end()
        self.win.show()
    def on_add(self,widget:fltk.Fl_Button):
        self.tasks.append(self.input.value())
        self.refresh_browser()
    def refresh_browser(self):
        self.browser.clear()
        for task in self.tasks:
            self.browser.add(task)
app = ToDoApp()
fltk.Fl.run()